package com.ljw.vendingmachine.utils;

public class Constant {
    //119.29.9.149/video/ad20190213.mp4
    public  static String BASEURL = "";
    public static String BASEPORT="";
/*
指令名	必选	类型	说明	来源
1	是	string	心跳检查	客户端
2	是	string	返回心跳检测需要的信息	服务端
11	是	string	获取商品列表	客户端
12	是	string	商品列表	服务端
21	是	string	获取商品二维码url	客户端
22	是	string	返回商品二维码url	服务端
23	是	string	通知客户端出游戏币	服务端
24	是	string	用户H5支付成功后通知客户端启动机器	服务端*/

    public static final String COMD_HEART = "{\"cmd\":\"0102\",\"reqtype\" :1}";//心跳检查
    public static final String COMD_LOGIN = "{\"cmd\":\"0100\",\"id\":%s,\"reqtype\":1}";//登录
    public static final String COMD_GET_MAIN_GOODS = "{\"cmd\":\"0201\", \"reqtype\" :1}";//获取首页商品信息
    //{cmd:0202, reqtype :1,data:{type:5}}
    public static final String COMD_GET_MORE_GOODS = "{cmd:0202, reqtype :1,data:{type:%d}}";//获取某个分类的数据
    public static final String COMD_GET_PAY_QRCODE = "{cmd:0203, reqtype :1,data:{type:\"%d\",\"ids\":\"%s\"}}";//支付二维码
    public static final String COMD_GOODS_OUT_SECCESS  = "{\"cmd\":\"0204\",reqtype:1,data:{\"ids\":\"%s\",\"orderNo\":\"%s\" }}";//出货完成通知服务器




    public static final String COMD_GET_ALL_GOODS_MSG  = "{\"cmd\":0305,reqtype:1}";//获取所有格子信息
    //{cmd:0302,data:{id:164,status:0},reqType :1}
    public static final String COMD_SINGLE_GOODS_TEST  = "{\"cmd\":0302 ,reqtype:1,data:{\"id\":\"%s\",\"status\":\"%s\" }}";//单个格子测试

    public static final int SEND_CMD = 0x1000;//发送命令到服务端
    public static final int RE_CONNECT = 0x1001;//发送命令到服务端
    public static final int CONNECT = 0x1008;//发送命令到服务端


    public static final int EVENTBUS_CODE_MAIN_GOODS_LIST = 0x1111;//传递首页商品列表数据
    public static final int EVENTBUS_CODE_MORE_GOODS_LIST = 0x1112;//传递更多商品列表数据
    public static final int EVENTBUS_CODE_FLUSH_TOTAL_SUMPRICE = 0x1113;//刷新总数与价格
    public static final int EVENTBUS_CODE_QRCODE = 0x1114;//获取二维码
    public static final int EVENTBUS_CODE_PAY_SECCESS = 0x1115;//获取二维码
    public static final int EVENTBUS_CODE_GOODS_OUT_SECCESS = 0x1116;//出货完成
    public static final int EVENTBUS_CODE_GOODS_OUT_FAIL = 0x1117;//出货失败
    public static final int EVENTBUS_CODE_GET_GOODS_LIST = 0x1119;//传递更多商品列表数据

    public static final int EVENTBUS_CODE_SINGLE_GOOD_TEST = 0x1120;//单个格子测试命令结果
    public static final int EVENTBUS_CODE_ALL_GOOD_TEST = 0x1121;//所有格子测试命令

    public static final int EVENTBUS_CODE_ALL_GOOD_LIST = 0x1123;//所有格子测试命令
    public static final int EVENTBUS_CODE_SINGLE_GOOD_TEST_RESULT = 0x1124;//格子测试结果


    public static final int SERIALPORT_CMD = 0x2000;//串口命令标识
    public static final int EVENTBUS_CODE_GOODS_OUT_SECCESS_next = 0x1122;//出货完成,执行下一条指令

    public static final int SERIALPORT_GEZI_TEST_CMD = 0x2001;//串口命令标识
    public static final int SERIALPORT_GEZI_START_TEST_CMD = 0x2021;//开始测试，逐条发送

    //  public static final int HEART=0x1011;//发送命令到服务端
    //串口设备路径
    public static final String SERIAL_PORT_PATH = "/dev/ttyS1";
    //波特率
    public static final int SERIAL_PORT_BAUDRATE = 9600;
    //控制11货道动作，限时0x8000ms
    //出货命令String[0] 通道号  String[1] 0代表关闭柜子或者电视机安装设备对于柜子只数字仅为1
   public static final String SERIAL_PORT_GOODS_OUT = "0402%s0101";
    public static final String SERIAL_PORT_GOODS_OUT_ACK = "0303%s01";
   public static final String SERIAL_PORT_GOODS_TEST_OUT = "8A8A030100010555";

    public static final String SERIAL_COMD ="8A8A%s55";
    public static final String IP="IP";
    public static final String PORT="PORT";
    public static final String PASSWORD="PASSWORD";
    public static final String DEVICEID="DEVICEID";
    public static final String NUMBERKEY="NUMBER";
    public static  int NUMBER=1;
}
